package util;

import model.SwingSize;

import javax.swing.*;
import java.awt.*;

/**
 * PackageName: util
 * ClassName: Config
 * Author: tum0r
 * Time: 2020/5/23 18:09
 */
public class Config {
    // 系统
    public static String LINE = System.lineSeparator();
    public static String TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";

    // 数据库
    public static String SQL_DRIVER = "org.sqlite.JDBC";
    public static String SQL_URL = "jdbc:sqlite:";
    public static String CREATE_FILE_INFORMATION_TABLE = "CREATE TABLE IF NOT EXISTS file_information(UUID TEXT NOT NULL PRIMARY KEY, Name text, Type char(64), CreateTime DATETIME, LastAccessTime DATETIME, Label TEXT, Size DOUBLE, Unit char(2), ContentID text, Fingerprint text)";
    public static String CREATE_FILE_CONTENT_TABLE = "CREATE TABLE IF NOT EXISTS file_content(UUID TEXT NOT NULL PRIMARY KEY, Data BLOB, Fingerprint text)";

    // 窗口
    public static String MAIN_TITLE = "本地资源管理器 Powered By 王小狂";
    public static SwingSize MAIN_SIZE = new SwingSize(0, 0, 1200, 960);
    public static Component MAIN_LOCATION = null;
    public static int MAIN_CLOSE = WindowConstants.EXIT_ON_CLOSE;
    public static Color MAIN_BACKGROUND_COLOR = new Color(20, 20, 20);
    public static Image MAIN_ICON = Toolkit.getDefaultToolkit().getImage("main_icon.png");
    public static boolean MAIN_RESIZABLE = false;
    public static LayoutManager MAIN_LAYOUT = null;

    // 主面板
    public static SwingSize MAIN_PANEL_SIZE = new SwingSize(0, 0, 1200, 960);
    public static Color MAIN_PANEL_BACKGROUND = new Color(20, 20, 20);
    public static LayoutManager MAIN_PANEL_LAYOUT = null;

    // 输入输出文件夹
    public static String IO_DIR_LABEL_TEXT = "输入/输出文件夹路径";
    public static SwingSize IO_DIR_LABEL_SIZE = new SwingSize(30, 20, 240, 40);
    public static Font IO_DIR_LABEL_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color IO_DIR_LABEL_FONT_COLOR = new Color(255, 165, 0, 200);

    public static boolean IO_DIR_PATH_EDITABLE = false;
    public static String IO_DIR_PATH_TEXT = IO_DIR_PATH_EDITABLE ? "" : "请选择文件夹";
    public static SwingSize IO_DIR_PATH_SIZE = new SwingSize(250, 20, 650, 40);
    public static Font IO_DIR_PATH_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color IO_DIR_PATH_FONT_COLOR = new Color(20, 20, 20);
    public static Color IO_DIR_PATH_BACKGROUND_COLOR = new Color(255, 165, 0, 200);
    public static int IO_DIR_PATH_TEXT_ALIGN = JTextField.CENTER;

    public static String IO_DIR_CHOOSE_TEXT = "选 择\u200B";
    public static SwingSize IO_DIR_CHOOSE_SIZE = new SwingSize(905, 20, 100, 40);
    public static Font IO_DIR_CHOOSE_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color IO_DIR_CHOOSE_FONT_COLOR = new Color(255, 165, 0, 200);
    public static Color IO_DIR_CHOOSE_BACKGROUND_COLOR = new Color(255, 165, 0, 200);

    public static String IO_DIR_CREATE_LABELS_TEXT = "创建标签文件";
    public static SwingSize IO_DIR_CREATE_LABELS_SIZE = new SwingSize(1010, 20, 160, 40);
    public static Font IO_DIR_CREATE_LABELS_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color IO_DIR_CREATE_LABELS_FONT_COLOR = new Color(255, 165, 0, 200);
    public static Color IO_DIR_CREATE_LABELS_BACKGROUND_COLOR = new Color(255, 165, 0, 200);

    // Labels.txt文件路径
    public static String LABELS_LABEL_TEXT = "标 签 文 件 路 径";
    public static SwingSize LABELS_LABEL_SIZE = new SwingSize(30, 65, 240, 40);
    public static Font LABELS_LABEL_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color LABELS_LABEL_FONT_COLOR = new Color(255, 165, 0, 200);

    public static boolean LABELS_PATH_EDITABLE = false;
    public static String LABELS_PATH_TEXT = LABELS_PATH_EDITABLE ? "" : "请选择标签文件";
    public static SwingSize LABELS_PATH_SIZE = new SwingSize(250, 65, 650, 40);
    public static Font LABELS_PATH_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color LABELS_PATH_FONT_COLOR = new Color(20, 20, 20);
    public static Color LABELS_PATH_BACKGROUND_COLOR = new Color(255, 165, 0, 200);
    public static int LABELS_PATH_TEXT_ALIGN = JTextField.CENTER;

    public static String LABELS_CHOOSE_TEXT = "选 择\u200B\u200B";
    public static SwingSize LABELS_CHOOSE_SIZE = new SwingSize(905, 65, 100, 40);
    public static Font LABELS_CHOOSE_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color LABELS_CHOOSE_FONT_COLOR = new Color(255, 165, 0, 200);
    public static Color LABELS_CHOOSE_BACKGROUND_COLOR = new Color(255, 165, 0, 200);

    public static String RESOURCE_WRITE_TEXT = "写入资源";
    public static SwingSize RESOURCE_WRITE_SIZE = new SwingSize(1010, 65, 160, 40);
    public static Font RESOURCE_WRITE_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color RESOURCE_WRITE_FONT_COLOR = new Color(255, 165, 0, 200);
    public static Color RESOURCE_WRITE_BACKGROUND_COLOR = new Color(255, 165, 0, 200);

    // Resources.db文件路径
    public static String RESOURCES_LABEL_TEXT = "数 据 库 路 径";
    public static SwingSize RESOURCES_LABEL_SIZE = new SwingSize(30, 110, 240, 40);
    public static Font RESOURCES_LABEL_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color RESOURCES_LABEL_FONT_COLOR = new Color(255, 165, 0, 200);

    public static boolean RESOURCES_PATH_EDITABLE = false;
    public static String RESOURCES_PATH_TEXT = RESOURCES_PATH_EDITABLE ? "" : "请选择数据库文件";
    public static SwingSize RESOURCES_PATH_SIZE = new SwingSize(250, 110, 650, 40);
    public static Font RESOURCES_PATH_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color RESOURCES_PATH_FONT_COLOR = new Color(20, 20, 20);
    public static Color RESOURCES_PATH_BACKGROUND_COLOR = new Color(255, 165, 0, 200);
    public static int RESOURCES_PATH_TEXT_ALIGN = JTextField.CENTER;

    public static String RESOURCES_CHOOSE_TEXT = "选 择\u200B\u200B\u200B";
    public static SwingSize RESOURCES_CHOOSE_SIZE = new SwingSize(905, 110, 100, 40);
    public static Font RESOURCES_CHOOSE_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color RESOURCES_CHOOSE_FONT_COLOR = new Color(255, 165, 0, 200);
    public static Color RESOURCES_CHOOSE_BACKGROUND_COLOR = new Color(255, 165, 0, 200);

    public static String RESOURCES_CREATE_DATABASE_TEXT = "创建数据库";
    public static SwingSize RESOURCES_CREATE_DATABASE_SIZE = new SwingSize(1010, 110, 160, 40);
    public static Font RESOURCES_CREATE_DATABASE_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color RESOURCES_CREATE_DATABASE_FONT_COLOR = new Color(255, 165, 0, 200);
    public static Color RESOURCES_CREATE_DATABASE_BACKGROUND_COLOR = new Color(255, 165, 0, 200);

    // 搜索
    public static String SEARCH_LABEL_TEXT = "搜索标签";
    public static SwingSize SEARCH_LABEL_SIZE = new SwingSize(180, 165, 150, 40);
    public static Font SEARCH_LABEL_FONT = new Font("Meslo LG L DZ for Powerline", Font.BOLD, 25);
    public static Color SEARCH_LABEL_FONT_COLOR = new Color(255, 165, 0, 200);

    public static SwingSize SEARCH_PANE_SIZE = new SwingSize(30, 210, 410, 210);
    public static SwingSize SEARCH_TEXT_SIZE = new SwingSize(0, 0, 410, 120);
    public static Font SEARCH_TEXt_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 22);
    public static Color SEARCH_TEXT_FONT_COLOR = new Color(20, 20, 20);
    public static Color SEARCH_TEXT_BACKGROUND_COLOR = new Color(123, 170, 215);

    public static String SEARCH_TEXT = "搜 索";
    public static SwingSize SEARCH_SIZE = new SwingSize(450, 210, 95, 210);
    public static Font SEARCH_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color SEARCH_FONT_COLOR = new Color(255, 165, 0, 200);
    public static Color SEARCH_BACKGROUND_COLOR = new Color(255, 165, 0, 200);

    // 文件提取和删除
    public static String FILE_LABEL_TEXT = "文件ID";
    public static SwingSize FILE_LABEL_SIZE = new SwingSize(800, 165, 150, 40);
    public static Font FILE_LABEL_FONT = new Font("Meslo LG L DZ for Powerline", Font.BOLD, 25);
    public static Color FILE_LABEL_FONT_COLOR = new Color(255, 165, 0, 200);

    public static SwingSize FILE_PANE_SIZE = new SwingSize(595, 210, 470, 210);
    public static SwingSize FILE_TEXT_SIZE = new SwingSize(0, 0, 470, 160);
    public static Font FILE_TEXt_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 22);
    public static Color FILE_TEXT_FONT_COLOR = new Color(20, 20, 20);
    public static Color FILE_TEXT_BACKGROUND_COLOR = new Color(123, 170, 215);

    public static String EXTRACT_TEXT = "提取文件";
    public static SwingSize EXTRACT_SIZE = new SwingSize(1075, 215, 95, 95);
    public static Font EXTRACT_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color EXTRACT_FONT_COLOR = new Color(255, 165, 0, 200);
    public static Color EXTRACT_BACKGROUND_COLOR = new Color(255, 165, 0, 200);

    public static String DELETE_TEXT = "删除文件";
    public static SwingSize DELETE_SIZE = new SwingSize(1075, 325, 95, 95);
    public static Font DELETE_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 21);
    public static Color DELETE_FONT_COLOR = new Color(255, 165, 0, 200);
    public static Color DELETE_BACKGROUND_COLOR = new Color(255, 165, 0, 200);

    // 搜索结果
    public static String[] SEARCH_RESULT_HEADER = new String[]{"文件ID", "文件名", "文件类型", "标签", "大小", "文件创建时间"};
    public static SwingSize SEARCH_RESULT_PANE_SIZE = new SwingSize(30, 450, 1140, 40);
    public static Color SEARCH_RESULT_PANE_BODY_BACKGROUND = new Color(20, 20, 20);
    public static SwingSize SEARCH_RESULT_SIZE = new SwingSize(30, 390, 1140, 444);
    public static Dimension SEARCH_RESULT_HEAD_SIZE = new Dimension(150, 40);
    public static Dimension SEARCH_RESULT_CELL_SIZE = new Dimension(1138, 40);
    public static Font SEARCH_RESULT_HEAD_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 18);
    public static Color SEARCH_RESULT_HEAD_BACKGROUND_COLOR = new Color(20, 20, 20);
    public static Color SEARCH_RESULT_HEAD_FONT_COLOR = new Color(255, 165, 0, 200);
    public static Color SEARCH_RESULT_SELECTED_FONT_COLOR = new Color(20, 20, 20);
    public static Color SEARCH_RESULT_SELECTED_BACKGROUND_COLOR = new Color(255, 165, 0, 210);
    public static Font SEARCH_RESULT_FONT = new Font("Meslo LG L DZ for Powerline", Font.PLAIN, 18);
    public static Color SEARCH_RESULT_BODY_BACKGROUND = new Color(20, 20, 20);
    public static Color SEARCH_RESULT_BACKGROUND_COLOR1 = new Color(153, 204, 255, 200);
    public static Color SEARCH_RESULT_FONT_COLOR1 = new Color(20, 20, 20);
    public static Color SEARCH_RESULT_BACKGROUND_COLOR2 = new Color(123, 170, 215, 180);
    public static Color SEARCH_RESULT_FONT_COLOR2 = new Color(20, 20, 20);
    public static Color SEARCH_RESULT_GRID_COLOR = new Color(255, 255, 255);

    // 进度信息
    public static String PROGRESS_LABEL_TEXT = "就绪";
    public static SwingSize PROGRESS_LABEL_SIZE = new SwingSize(30, 895, 1140, 40);
    public static Font PROGRESS_LABEL_FONT = new Font("Meslo LG L DZ for Powerline", Font.BOLD, 17);
    public static Color PROGRESS_LABEL_FONT_COLOR_NORMAL = new Color(255, 165, 0, 200);
    public static Color PROGRESS_LABEL_FONT_COLOR_ERROR = new Color(255, 0, 0);
}
